using System;
using System.Linq;
using Kollektiv.DB;
using System.Collections.Generic;

namespace Kollektiv.DataModel
{
	public class EmailContentRepository:DataRepository<EmailContent>
	{
        public EmailContentRepository(DataManager manager)
            : base(manager)
		{
		}
		
		public EmailContent Create (string type, Language language, string title, string text, IEnumerable<Attachment> attachments)
		{
			EmailContent emailContent = new EmailContent (){
				Type = type,
				Language = language,
				Title=title,
				Text=text,
				Attachments=attachments
			};
			
			this.SaveOrUpdate (emailContent);
			
			return emailContent;
		}
	}
}

